﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Text;
using System.Threading.Tasks;
using Castle.Facilities.WcfIntegration;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using M2B.GestionEntretiens.DAL;
using M2B.GestionEntretiens.Contracts;


namespace M2B.GestionEntretiens.TestConsol
{
    class Program
    {
        static IWindsorContainer _container;

        static Program()
        {
            _container = new WindsorContainer();
            _container.AddFacility<WcfFacility>().Register
            (
             Component.For<IUnitOfWork>().ImplementedBy<UnitOfWork>(),
              Component.For<ICandidatsService>()
              .AsWcfClient(new DefaultClientModel
              {
                  Endpoint = WcfEndpoint.BoundTo(new BasicHttpBinding())
                                        .At("http://localhost:58536/CandidatsService.svc")
              })
            );
        }

        static void Main(string[] args)
        {
            var client = _container.Resolve<ICandidatsService>();
            var post = client.DoWork();
            var result = client.GetCandidats();



            Console.ReadKey();

            if (_container != null)
                _container.Dispose();
        }
    }
}
